package com.huxi.lang.validation.predicate;

import java.util.Objects;

public class Not implements VPredicate {

	private final VPredicate predicate;

	public Not(VPredicate predicate) {
		this.predicate = Objects.requireNonNull(predicate);
	}

	@Override
	public boolean test(Object t, boolean valueIfNull, boolean valueIfIllegalType) {
		return !predicate.test(t, valueIfNull, valueIfIllegalType);
	}
}
